package refactor.formtemplatemethod;

public class HtmlStatement extends Statement {

    @Override
    protected String footerString(Customer customer) {
        String result = "";
        //add footer lines
        result += "<P>Amount owed is " + customer.calcTotalAmount() + "</P>\n";
        result += "<P>You earned " + customer.calcFrequentRenterPoints() +
                " frequent renter points</P>";
        return result;
    }

    @Override
    protected String eachRentalString(Rental rental) {

        return "\t" + rental.getMovie().getTitle() + ":" +
                rental.getCharge() + "<BR>\n";
    }

    @Override
    protected String headerString(Customer customer) {
        String result = "<H1>Rental Record for " + customer.getName() + "</H1>\n";
        return result;
    }
}